#### pitchAmp does not work with Csound 5.09 ###

setGlobalDuration(-1)

example = 3

a = genWaveform([1,0,.3,.1])
playSound('ounkmaster.aif', loop=True, out='snd')

if example == 1:
    # send a transposition value where 1. == centralpitch
    pitchAmp(input='snd', pitchbus='pit', ampbus='amp', maxfreq=300, centralpitch=100)
    waveform(pitch=[999,1000,1001], table=a, pitchVar='pit', amplitudeVar='amp')

if example == 2:
    centroid(input='snd', bus='cent')
    freqMod(pitch=[52,99,153,205], modulator=[.49,.5,.51], index=10, out='fm')
    bandpass(input='fm', cutoff=22000, bandwidth=1000, cutoffVar='cent', bandwidthVar='cent')
    toDac(input='snd', amplitude=.3)

if example == 3:
    rms(input='snd', bus='rms')
    freqMod(pitch=[52,99,153,205], modulator=[.49,.5,.51], index=10, amplitudeVar='rms')
    toDac(input='snd', amplitude=.3)
startCsound()
